#ifndef _IAP_H
#define _IAP_H

#include "common_h.h"

#if IAP_DEBUG > 0
#define   iap_debug         lite_printf
#else 
#define   iap_debug(fmt,...) 	;
#endif

#define K 		(1024)
#define IC_FLASH_SIZE	(512*K)
#define IC_BASE_ADDR	(0x10000000)

#define BOOT_ADDR		(IC_BASE_ADDR)
#define BOOT_OFT		(32*K)

#define APP_ADDR		(BOOT_ADDR + BOOT_OFT)
#define APP_OFT			(478*K)

#define PARA_ADDR		(APP_ADDR + APP_OFT)
#define PARA_OFT		(2*K)

#define OTP_ADDR		(0x10101000)
#define OTP_OFT			(1*K)

u8 iap_enter_upgrade(void);
u8  iap_write_flash(const u32 addr, const u8 *data, u32 len);


#endif

